home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacHack 2000
/
MacHack 2000.toast
/
pc
/
The Hacks
/
Softshoe
/
Lisa's Mac Parts
/
Pascal Strings
/
MessageString.h
< prev
next >
Wrap
Text File
|
2000-06-23
|
1KB
|
71 lines
// MessageString.h
#ifndef MessageString_h
#define MessageString_h
#ifndef Str_h
#include "Str.h"
#endif
#ifndef ResourceID_h
#include "ResourceID.h"
#endif
class MessageString: public String255
{
public:
class Substitution;
MessageString( ResourceID, uint16 itemNumber );
inline Substitution Substitute( uint8, ConstData );
};
class MessageString::Substitution
{
friend Substitution MessageString::Substitute( uint8, ConstData );
private:
MessageString *target;
Substitution *next;
ConstData replacement;
uint8 toReplace;
// not implemented:
void operator=( const Substitution& );
Substitution( MessageString& theTarget,
uint8 source,
ConstData theReplacement )
: target( &theTarget ),
toReplace( source ),
replacement( theReplacement ),
next( 0 )
{}
Substitution( Substitution& theNext,
uint8 source,
ConstData theReplacement )
: target( theNext.target ),
toReplace( source ),
replacement( theReplacement ),
next( &theNext )
{}
void Substitute();
public:
~Substitution();
Substitution Substitute( uint8 s, ConstData r )
{
return Substitution( *this, s, r );
}
};
inline MessageString::Substitution MessageString::Substitute( uint8 s, ConstData r )
{
return Substitution( *this, s, r );
}
#endif